package edu.uw.cs.cse461.sp12.utilIP;

import android.net.wifi.WifiInfo;
import android.net.wifi.WifiManager;
import android.text.format.Formatter;

//ANDROID IMPLEMENTATION OF IPFINDER
public class IPFinder {

	public static String getLocalIP() {
		WifiManager wifiManager = (WifiManager)MyContext.context.getSystemService(MyContext.context.WIFI_SERVICE);
        WifiInfo wifiInfo = wifiManager.getConnectionInfo();
        int wifiIPInt = wifiInfo.getIpAddress();
        String wifiIP = Formatter.formatIpAddress(wifiIPInt);
        
	    return wifiIP;
	}
}
